<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // Proxy
        var obj = {
            count: 1,
        }

        var p = new Proxy(obj, {
            set: function (target, property, value, receiver) {
                if (property == 'count') {
                    console.log('Proxy.set', target, property, value, receiver)
                    var res = Reflect.set(target, property, value, receiver)
                    return res
                }

                return Reflect.set(target, property, receiver)
            },
        })

        p.count = 2
        p['count'] = 3
        Reflect.set(p, 'count', 4)

        var subP = Object.create(p)
        subP['count'] = 5
        subP['count'] = 6 // <无输出>
    </script>
</body>

</html>